<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>SQL转Java JPA、MYBATIS实现类代码生成平台</title>
    <meta name="keywords" content="sql转实体类,sql转DAO,SQL转service,SQL转JPA实现,SQL转MYBATIS实现">
    <#import "common/common-import.html" as netCommon>
    <@netCommon.commonStyle />
    <@netCommon.commonScript />
    <#--
    <script src="${request.contextPath}/static/js/index-new.js"></script>
    -->
    <script>
    $(function () {
        var genCodeArea = CodeMirror.fromTextArea(document.getElementById("genCodeArea"), {
                    lineNumbers: true,
                    matchBrackets: true,
                    mode: "text/x-java",
                    lineWrapping:true,
                    readOnly:true,
                    foldGutter: true,
                    gutters:["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
         });
        genCodeArea.setSize('auto','auto');


        $('#btnGenCode1').bind('click', function () {
           $.ajax({
               type: 'POST',
               url: "/createSingleFile",
               data: {
                   "code":$("#genCodeArea").val(),
                   "filePath":$("#path").val(),
                   "fileName": $("#fileNameId").html()
                },
                    dataType: "json",
               });

        });

    });

    </script>
</head>
<body style="background-color: #e9ecef">
<div>
    <div class="container">
        <button class="btn btn-primary btn-md disabled" id="btnGenCode1" role="button">保存代码 »</button>
        <input type="text" id="path" name="path" placeholder="${path}" value="${path}" style="width:100%">
        <span>目录：<a>${path}</a></span><b id="fileNameId">${fileName}</b>
        <textarea id="genCodeArea" class="form-control btn-lg generator">${code}</textarea>
    </div>
</div>
</body>
</html>
